package com.atguigu;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class T4 {
//订单金额java类用bigdecimal
    public static void m(){
        BigDecimal amout1 = new BigDecimal("0.03");
        BigDecimal amout2 = new BigDecimal("0.02");//bigdecimal不能直接用数字类型，要用string类型
        System.out.println(amout1.subtract(amout2));

        BigDecimal amout3 = BigDecimal.valueOf(0.03);
        BigDecimal amout4 = BigDecimal.valueOf(0.02);
        System.out.println(amout3.subtract(amout4));


    }
    public static void main(String[] args) {
        //CopyOnWriteArrayList<>
        m();
    }
}
